#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>

//https://leetcode.cn/problems/linked-list-cycle-ii/description/

struct ListNode {
    int val;
    struct ListNode *next;
};

bool hasCycle(struct ListNode* head) {
    if (head == NULL || head->next == NULL) {
        return false;
    }
    struct ListNode* slow = head;
    struct ListNode* fast = head->next;
    while (slow != fast) {
        if (fast == NULL || fast->next == NULL) {
            return false;
        }
        slow = slow->next;
        fast = fast->next->next;
    }
    return true;
}


int main() {

    return 0;
}